<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>山东营销风云榜</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../css/part/tabHead.css">
    <link rel="stylesheet" href="../../../css/part/mini.css">
</head>

<body>

<div id="app">
    <div id="tableHead">
        <img src="../../../img/part/realAct/branchBC.png" id="branchHead" align="center">
        <a href="../../portal/navigationYX.html"><img src="../../../img/portal/min.png" id="miniImg"></a>
        <table width="100%">
            <tr >
                <thead>
                <th width="8%">NO</th>
                <th width="14%">机构</th>
                <th width="13%">当月预收万元</th>
                <th width="13%">当月承保万元</th>
            <!--    <th width="13%">当月预收健康</th>
                <th width="13%">当月承保健康</th>-->
                <th width="13%">当月预收实动</th>
                <th width="13%">当月承保实动</th>
                </thead>
            </tr>
        </table>
    </div>
    <div id="midDiv"></div>
    <div class="tableBody">
        <table id="tab" width="100%">
            <tbody id="tbody">
            </tbody>
        </table>
    </div>
</div>
</body>
<script src="../../../js/vue.js"></script>
<script src="../../../js/axios.js"></script>
<script src="../../../js/head.js"></script>
<script src="../../../js/jquery-3.2.1.min.js"></script>
<script src="../../../js/share.js"></script>

<script>
    window.onload = function () {
        new Vue({
            el: '#app',
            data() {
                return {
                    //中支名称
                    branchsName: '',
                    //预收实动
                    branchBcAdvance5000: 0,
                   /* //预收健康
                    branchBcAdvance7000: 0,*/
                    //预收万元
                    branchBcAdvance10000: 0,

                    branchBcInSure5000: 0,
                 /*   branchBcInSure7000: 0,*/
                    branchBcInSure10000: 0,

                    pojo: {},
                    divHeight: 0,

                }
            },
            created() {
                this.getBranchBc();
            },
            methods: {

                //获取各中支的数据
                getBranchBc() {
                    document.getElementById("midDiv").style.height = window.getComputedStyle(document.getElementById("tableHead")).getPropertyValue("height");
                    setTimeout(() => {
                        axios.get(`/realAct/getBranchBcAct`).then(response => {
                            this.pojo = response.data;
                            var str = "";//定义用于拼接的字符串
                            for (var i = 0; i < this.pojo.length; i++) {
                                this.branchBcAdvance5000 = this.branchBcAdvance5000 + this.pojo[i].branchBcAdvance5000;
                                this.branchBcAdvance7000 = this.branchBcAdvance7000 + this.pojo[i].branchBcAdvance7000;
                                this.branchBcAdvance10000 = this.branchBcAdvance10000 + this.pojo[i].branchBcAdvance10000;
                                this.branchBcInSure5000 = this.branchBcInSure5000 + this.pojo[i].branchBcInSure5000;
                                this.branchBcInSure7000 = this.branchBcInSure7000 + this.pojo[i].branchBcInSure7000;
                                this.branchBcInSure10000 = this.branchBcInSure10000 + this.pojo[i].branchBcInSure10000;
                                str = "<tr><td width=\"8%\">" + (i + 1) + "</td>" +
                                    "<td width=\"14%\">" + this.pojo[i].branchsName + "</td>" +
                                    "<td width=\"13%\">" + this.pojo[i].branchBcAdvance10000 + "</td>" +
                                    "<td width=\"13%\">" + this.pojo[i].branchBcInSure10000 + "</td>" +
                                   /* "<td width=\"13%\">" + this.pojo[i].branchBcAdvance7000 + "</td>" +
                                    "<td width=\"13%\">" + this.pojo[i].branchBcInSure7000 + "</td>" +*/
                                    "<td width=\"13%\">" + this.pojo[i].branchBcAdvance5000 + "</td>" +
                                    "<td width=\"13%\">" + this.pojo[i].branchBcInSure5000 + "</td></tr>";
                                //追加到table中
                                $("#tbody").append(str);
                            }
                            str = "<tr><th colspan=\"2\" style=\"font-weight: bolder\">" + '合计:' + "</th>" +
                                "<th width=\"13%\">" + this.branchBcAdvance10000 + "</th>" +
                                "<th width=\"13%\">" + this.branchBcInSure10000 + "</th>" +
                             /*   "<th width=\"13%\">" + this.branchBcAdvance7000 + "</th>" +
                                "<th width=\"13%\">" + this.branchBcInSure7000 + "</th>" +*/
                                "<th width=\"13%\">" + this.branchBcAdvance5000 + "</th>" +
                                "<th width=\"13%\">" + this.branchBcInSure5000 + "</th></tr>";
                            $("#tbody").append(str);

                        })
                    }, 200)
                },
            }
        })
    }
</script>

</html>